home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 September & October / rerun-1986-09-10.d64 / balance sheet (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  7.5 KB  |  296 lines

  1. 10 poke808,234
  2. 20 printchr$(14):printchr$(8):print"[147]":poke53280,11:poke53281,11
  3. 30 printtab(8)"[158]** [208]ress [210]eturn **"
  4. 40 input"[145][145][145][145][197]nter [198]ile [206]ame";r$:r$=left$(r$,10)
  5. 50 x=96:r=2*x
  6. 60 dimd$(r),i$(r),d(r),c(r),b(r),u(r),h(r):n=0
  7. 70 input"[201]f [197]stablishing [206]ew [198]ile,[201]nsert (*)";y$
  8. 80 poke53280,6:poke53281,15
  9. 90 ify$="*"then110
  10. 100 ify$=""thengosub990
  11. 110 poke650,0:poke53280,6
  12. 120 poke53281,15
  13. 130 print"[147][151][194]alance [211]heet[146]"
  14. 140 print"[198]1 [198]orward [211]can   [151]_ [210]everse [211]can"
  15. 150 print"[151][198]4 [197]nter [201]nformation"
  16. 160 print"[151][198]5 [194]alance [211]heet"
  17. 170 print"[151][198]6 [204]ast [208]age"
  18. 180 print"[151]=  [212]otal [196]ebits/[195]redits"
  19. 190 print"[151]*  [211]elect [206]ew [198]ile"
  20. 200 print"[151]^  [210]ename [198]ile"
  21. 210 print"[151]%  [210]e-[197]stablish [198]ile"
  22. 220 print"[151][211]  [211]ave"
  23. 230 print"[151][195]  [195]hronological [211]ort"
  24. 240 print"[151][208]  [208]rint"
  25. 250 print"[151]+  [197]xit"
  26. 260 gosub420
  27. 270 geta$:ifa$=""then270
  28. 280 ifa$="[133]"thenab=1:goto730
  29. 290 ifa$="_"thenab=n:goto730
  30. 300 ifa$="[138]"then480
  31. 310 ifa$="s"thengosub1090
  32. 320 ifa$="[139]"then1820
  33. 330 ifa$="[135]"then1500
  34. 340 ifa$="="then1900
  35. 350 ifa$="*"then clr:goto20
  36. 360 ifa$="^"then2070
  37. 370 ifa$="c"thengosub2170
  38. 380 ifa$="%"then2260
  39. 390 ifa$="p"thengosub2620
  40. 400 ifa$="+"then9999
  41. 410 goto110
  42. 420 print"[151]----------------------------------------"
  43. 430 print"[198]ile:[156] ";r$
  44. 440 printtab(21)"[151][145][197]ntries:[156]";n
  45. 450 print"[151][194]alance:[156]";b(n)
  46. 460 ifd$(n)>"a"thend$(n)="--"
  47. 470 printtab(21)"[151][145][204]ast [196]ate: [156]";d$(n):return
  48. 480 poke53280,6:ifn=x-1then720
  49. 490 print"[147][151][196]ata[160][197]ntry"
  50. 500 n=n+1:print"[147][197]nter [201]nformation[146]"
  51. 510 print"[197]ntry[160]#";n
  52. 520 print"[196]ate  ";d$(n-1)
  53. 530 print"[201]tem":print"[196]ebit":print"[195]redit":b(n)=d(n)+c(n):b(n)=b(n)+b(n-1)
  54. 540 print"[194]alance [201]s: ";b(n):print""
  55. 550 input"";d$(n):ifd$(n)>="a"ord$(n)=""thend$(n)="--"
  56. 560 d$(n)=left$(d$(n),6)
  57. 570 input"";i$(n):ifi$(n)=""theni$(n)="--"
  58. 580 i$(n)=left$(i$(n),28)
  59. 590 input"";d(n):d(n)=-d(n)
  60. 600 input"";c(n)
  61. 610 b(n)=d(n)+c(n):b(n)=b(n)+b(n-1):b(n)=int(b(n)/0.01+0.5)*0.01
  62. 620 print"[194]alance [201]s:[155]               "
  63. 630 print"[145][194]alance [201]s: ";b(n)
  64. 640 printtab(9)"[151][193]nother [197]ntry?[146] [217]/[206]"
  65. 650 printtab(9)"[151][193]bort[146] [193] [151][210]e-[197]nter[146] [210][151]"
  66. 660 geta$:ifa$<>"y"anda$<>"n"anda$<>"r"anda$<>"a"then660
  67. 670 ifa$="n"then110
  68. 680 ifa$="r"thenm=n:gosub1480
  69. 690 ifa$="a"thenm=n:gosub1480:goto110
  70. 700 ifn=x-1then720
  71. 710 goto500
  72. 720 print"[147]":printtab(15)"[151][198][201][204][197][160][198][213][204][204]":forzz=1to2000:next:goto110
  73. 730 poke53280,6:ifn=0then110
  74. 740 form=abton
  75. 750 poke650,128:gosub900
  76. 760 print"[151][198]1[146] [198]orward [211]can  _[146] [210]everse [211]can"
  77. 770 ifm>nthen110
  78. 780 print"[198]5[146] [194]alance [211]heet"
  79. 790 print"[198]7[146] [210]eturn to [205]ain [205]enu"
  80. 800 print"[198]2[146] [205]ake a [195]hange"
  81. 810 print"[198]8[146] [197]rase this [197]ntry"
  82. 820 geta$:ifa$=""then820
  83. 830 ifa$="_"thenm=m-2:ifm<0then110
  84. 840 ifa$="[135]"thenpoke650,0:goto1500
  85. 850 ifa$="[139]"thenpoke650,0:goto1820
  86. 860 ifa$="[136]"then110
  87. 870 ifa$="[137]"thengosub1240
  88. 880 ifa$="[140]"thengosub1420:a=m:gosub1840:m=a
  89. 890 next:goto110
  90. 900 ifm>nthenreturn
  91. 910 print"[147][151][197]ntry #";m
  92. 920 print"[196]ate:     ";d$(m)
  93. 930 print"[201]tem:     ";i$(m)
  94. 940 print"[196]ebit:   ";d(m)
  95. 950 print"[195]redit:  ";c(m)
  96. 960 gosub2940
  97. 970 print"[194]alance: ";b(m)
  98. 980 print"[151]----------------------------------------":return
  99. 990 print"[147][151][204]oading[156]";r$
  100. 1000 open15,8,3,"0:"+r$+",seq"
  101. 1010 input#15,n
  102. 1020 form=1ton
  103. 1030 input#15,d$(m)
  104. 1040 input#15,i$(m)
  105. 1050 input#15,d(m)
  106. 1060 input#15,c(m)
  107. 1070 input#15,b(m)
  108. 1080 next:close15:return
  109. 1090 ifn=0thenreturn
  110. 1100 print"[147][151][217]ou selected [211]ave. [193]re you sure?"
  111. 1110 printtab(16)"[217]/[206]"
  112. 1120 geta$:ifa$<>"y"anda$<>"n"then1120
  113. 1130 ifa$="n"thenreturn
  114. 1140 print"[147][151][211]aving[156]";r$
  115. 1150 open15,8,4,"@0:"+r$+",s,w"
  116. 1160 print#15,n
  117. 1170 form=1ton
  118. 1180 print#15,d$(m)
  119. 1190 print#15,i$(m)
  120. 1200 print#15,d(m)
  121. 1210 print#15,c(m)
  122. 1220 print#15,b(m)
  123. 1230 next:close15:return
  124. 1240 poke650,0:ifn=0thenreturn
  125. 1250 gosub900:printtab(12)"[156]** [195]hange **[151]"
  126. 1260 print"1-[196]ate","2-[201]tem","3-[196]ebit","4-[195]redit"
  127. 1270 printtab(9)"[156][197]nter (1,2,3, or 4)[151]"
  128. 1280 forzz=1to400:next
  129. 1290 geta$:ifa$=""then1350
  130. 1300 ifa$="1"thengosub1370
  131. 1310 ifa$="2"thengosub1380
  132. 1320 ifa$="3"thengosub1390
  133. 1330 ifa$="4"thengosub1410
  134. 1340 return
  135. 1350 print"[145][145]                            "
  136. 1360 forzz=1to75:next:print"[145][145][145][145]":goto1270
  137. 1370 jj$="--":print:input"[206]ew [196]ate";jj$:d$(m)=jj$:m=m-1:return
  138. 1380 jj$="--":print:input"[206]ew [201]nformation";jj$:i$(m)=jj$:m=m-1:return
  139. 1390 jj=0:print:input"[206]ew [196]ebit (pos.only)";jj:d(m)=-jj:m=m-1:a=m:gosub1840
  140. 1400 m=a:return
  141. 1410 jj=0:print:input"[206]ew [195]redit";jj:c(m)=jj:m=m-1:a=m:gosub1840:m=a:return
  142. 1420 ifn=0thenreturn
  143. 1430 print"[147][151][193]re you sure you want to erase this?"
  144. 1440 printtab(18)"[217]/[206]"
  145. 1450 geta$:ifa$<>"n"anda$<>"y"then1450
  146. 1460 ifa$="n"thenm=m-1:return
  147. 1470 print"[147][151][213]pdating[160][198]ile"
  148. 1480 forv=mton:d$(v)=d$(v+1):i$(v)=i$(v+1):d(v)=d(v+1):c(v)=c(v+1):next
  149. 1490 n=n-1:m=m-1:return
  150. 1500 ifn=0then110
  151. 1510 gosub1860:xx=1:yy=19
  152. 1520 ifyy>nthenyy=n
  153. 1530 form=xxtoyy:ifm>x-1then110
  154. 1540 print"[151]";m:print"[145]"d$(m)
  155. 1550 d(m)=-d(m):ifd(m)=0then1800
  156. 1560 printtab(10)"[145]"d(m)
  157. 1570 d(m)=-d(m):ifc(m)=0then1810
  158. 1580 printtab(19)"[145][151]"c(m)
  159. 1590 ifd(m)=0andc(m)=0then1780
  160. 1600 printtab(29)"[145]"b(m)
  161. 1610 next
  162. 1620 geta$:ifa$="[135]"then1710
  163. 1630 ifa$="[136]"then110
  164. 1640 ifa$="[139]"then1820
  165. 1650 ifa$="r"thengoto1750
  166. 1660 ifa$="[133]"thenab=1:goto730
  167. 1670 ifa$="_"thenab=n:goto730
  168. 1680 ifa$="[138]"then480
  169. 1690 ifa$="="then1900
  170. 1700 goto1620
  171. 1710 xx=xx+19:yy=yy+19
  172. 1720 gosub1860:ifxx>=x-1then110
  173. 1730 ifyy-19>=nthen110
  174. 1740 goto1520
  175. 1750 input"[151]match which item number";k
  176. 1760 ifk<1then110
  177. 1770 print"[147]":poke53280,6:form=kton:goto750
  178. 1780 ifm<=nthenprinttab(29)"[145]"b(m)
  179. 1790 printtab(31)"[145]":goto1610
  180. 1800 printtab(11)"[145]":goto1570
  181. 1810 printtab(21)"[145]":goto1590
  182. 1820 print"[147]":poke53280,9:ifn<19then1500
  183. 1830 xx=n-13:yy=n+5:goto1720
  184. 1840 print"[147][151][213]pdating[160][194]alance"
  185. 1850 form=1ton:gosub2940:next:return
  186. 1860 print"[147]":poke53280,9:poke53281,15
  187. 1870 print"[195]ontinue-([198]5)   [210]ead-([210])   [205]enu-([198]7)"
  188. 1880 print"[156][196][193][212][197][196][197][194][201][212][195][210][197][196][201][212][194][193][204][193][206][195][197]"
  189. 1890 return
  190. 1900 poke53280,6:ifn=0then110
  191. 1910 print"[147][151][196]ebits/[195]redits[146]"
  192. 1920 print"":gosub420
  193. 1930 print"":form=1ton:u(m)=c(m)+0
  194. 1940 printtab(8)"[151][145][212]otal [195]redits[160]are:"
  195. 1950 print"[145]"m
  196. 1960 u(m)=u(m)+u(m-1):next
  197. 1970 printtab(27)"[145]";u(n)
  198. 1980 print"":form=1ton:u(m)=d(m)+0
  199. 1990 form=1ton:u(m)=d(m)+0:u(m)=d(m)+0
  200. 2000 printtab(8)"[151][145][212]otal [196]ebits are:"
  201. 2010 print"[145]"m
  202. 2020 u(m)=u(m)+u(m-1):next
  203. 2030 printtab(27)"[145]";u(n)
  204. 2040 print"[208][210][197][211][211] [193][206][217][160][203][197][217][160][212][207][160][210][197][212][213][210][206] [212][207][160][205][197][206][213]         "
  205. 2050 geta$:ifa$=""then2050
  206. 2060 goto110
  207. 2070 print"[147][151][193]re you sure you want to [210]ename"
  208. 2080 printtab(13)"this file?":printtab(17)"[217]/[206]"
  209. 2090 geta$:ifa$<>"y"anda$<>"n"then2090
  210. 2100 ifa$="n"then110
  211. 2110 input"[151][197]nter [206]ew [198]ile [206]ame[156]";v$
  212. 2120 v$=left$(v$,10)
  213. 2130 print"[147][151][196]o you want this executed on disk? [217]/[206]"
  214. 2140 geta$:ifa$<>"y"anda$<>"n"then2140
  215. 2150 ifa$="n"thenr$=v$:goto110
  216. 2160 open15,8,15:print#15,"r0:"+v$"="+r$"":r$=v$:close15:goto130
  217. 2170 ifn<=1thenreturn
  218. 2180 print"[147][151][208]lacing [201]tems in order by [196]ate"
  219. 2190 printtab(12)""
  220. 2200 ex=0:forq=1ton-1:poke53280,5:ifd$(q)>d$(q+1)then2230
  221. 2210 next:ifex<>0then2200
  222. 2220 gosub1840:return
  223. 2230 g$=d$(q):h$=i$(q):j=d(q):t=c(q)
  224. 2240 d$(q)=d$(q+1):i$(q)=i$(q+1):d(q)=d(q+1):c(q)=c(q+1):poke53280,14
  225. 2250 d$(q+1)=g$:i$(q+1)=h$:d(q+1)=j:c(q+1)=t:ex=1:goto2210
  226. 2260 ifn<5then110
  227. 2270 print"[147][151][210]e-[197]stablish [198]ile[146]"
  228. 2280 printtab(12)"[193] [151][193]bort"
  229. 2290 printtab(12)"[208] [151][208]reserve old [198]ile"
  230. 2300 printtab(12)"[197] [151][197]rase old [198]ile"
  231. 2310 geta$:ifa$=""then2310
  232. 2320 ifa$="a"then110
  233. 2330 ifa$="p"then2540
  234. 2340 ifa$="e"then2360
  235. 2350 goto2310
  236. 2360 gosub2580
  237. 2370 print"[147][151][210]e-[197]stablish [198]ile[146]"
  238. 2380 print"[151][195]urrent [206]o. of [197]ntries:[156] ";n
  239. 2390 printtab(7)"[151]( [205]in: 0 ";"[205]ax:";n-5;")"
  240. 2400 input"[145][145][145][151][200]ow [205]any [197]ntries [208]reserved[156] ";gg
  241. 2410 printtab(10)"[151][197]rasing [197]ntry:[146]"
  242. 2420 ifgg>n-5orgg<0then2260
  243. 2430 bb=b(n-gg)
  244. 2440 form=1ton
  245. 2450 d$(m)=d$(m+(n-gg)):i$(m)=i$(m+(n-gg))
  246. 2460 d(m)=d(m+(n-gg)):c(m)=c(m+(n-gg)):b(m)=b(m+(n-gg))
  247. 2470 ifm>n-ggthen2490
  248. 2480 printtab(25)"[145][156]";m
  249. 2490 next
  250. 2500 n=gg+1:ifgg=0thenb(n)=bb
  251. 2510 ifbb<0thend(n)=bb
  252. 2520 ifbb>=0thenc(n)=bb
  253. 2530 d$(n)="******":i$(n)="[194]alance [198]orward":gosub2170:gosub1140:goto110
  254. 2540 gosub2580:v$=r$
  255. 2550 input"[147][197]nter [206]ew [206]ame for old [198]ile";r$
  256. 2560 r$=left$(r$,10)
  257. 2570 gosub1140:r$=v$:goto2370
  258. 2580 print"[147][208]rint the old [198]ile ? [217]/[206]
  259. 2590 [161]a$:[139]a$[179][177]"y"[175]a$[179][177]"n"[167]2590
  260. 2600 [139]a$[178]"y"[167][141]2620
  261. 2610 [142]
  262. 2620 [139]n[178]0[167][142]
  263. 2630 [153]"loadpoke(NULL)rintwait"
  264. 2640 [153][163]14)"len  pokelenontinue"
  265. 2650 [153][163]14)"atn  pokeatnbort"
  266. 2660 [161]a$:[139]a$[178]""[167]2660
  267. 2670 [139]a$[179][177]"c"[167][142]
  268. 2680 [153]"load(NULL)ress (NULL)val(NULL)(NULL)(NULL)(NULL) for a ascull (NULL)rint"
  269. 2690 [133]"onononon(NULL)rint ascrom (NULL)hat str$ate ";sd$
  270. 2700 [159]4,4,7:[153]"(NULL)aging (NULL)n ?  (NULL)/(NULL)"
  271. 2710 [161]a$:[139]a$[179][177]"y"[175]a$[179][177]"n"[167]2710
  272. 2720 [139]a$[178]"n"[167]sp[178]0.5:[137]2740
  273. 2730 sp[178]5
  274. 2740 [153]"load":[153][163]9)"(NULL)rinting, (NULL)leaseclose(NULL)ait"
  275. 2750 [152]4,[199](16)"27";"ascright$(NULL)val(NULL)atn(NULL)val: ";r$
  276. 2760 [152]4,[199](10)
  277. 2770 [152]4,[199](16)"00";"str$atn(NULL)val";[199](16)"10";"right$(NULL)val(NULL)";[199](16)"46";"str$valpeekright$(NULL)";
  278. 2780 [152]4,[199](16)"58";"len(NULL)valstr$right$(NULL)";[199](16)"70";"peekatn(NULL)atn(NULL)lenval"
  279. 2790 [152]4,[199](10)
  280. 2800 [129]m[178]1[164]n
  281. 2810 [139]d$(m)[177][178]sd$[167]sp[178]sp[170]1:[141]2860
  282. 2820 [139]sd$[178]"chr$(13)"[167]sd$[178]"*****"
  283. 2830 [130]
  284. 2840 [152]4,[199](12):[160]4
  285. 2850 sd$[178]"*****":[142]
  286. 2860 [152]4,[199](16)"00";d$(m);[199](16)"10";i$(m);
  287. 2870 [139]d(m)[178]0[167]2890
  288. 2880 [152]4,[199](16)"45"d(m);
  289. 2890 [139]c(m)[178]0[167]2910
  290. 2900 [152]4,[199](16)"57";c(m);
  291. 2910 [152]4,[199](16)"69";b(m)
  292. 2920 [139]sp[178]56[167][152]4,[199](12):sp[178]0
  293. 2930 [142]
  294. 2940 b(m)[178]c(m)[170]d(m):b(m)[178]b(m)[170]b(m[171]1):b(m)[178][181](b(m)[173]0.01[170]0.05)[172]0.01:[142]
  295. 9999 [158]2048
  296.